package com.operation;

import org.json.JSONObject;

public class KeepTime {
	/**
	 * 
	 * 区域操作计时
	 * @return
	 */
	public static int areaKeepTime(int userid,int duration, String userIp,String url,String gateIp){
		System.out.println("时长定时下线-------");
		HttpSendUrl send = new HttpSendUrl();
		String param = "userid="+userid+"&duration="+duration+"&userIp="+userIp;
		//url = "http://"+gateIp+url+"?userid="+userid+"&duration="+duration+"&userIp="+userIp;
		int ru = 0;
		try {
			String sendRequest = send.getSendRequest(url,param, "POST",5000);
			JSONObject js = new JSONObject(sendRequest);
			ru = Integer.parseInt(js.get("code").toString());
		} catch (Exception e) {
			ru=-1;
			e.printStackTrace();
		}
		System.out.println("时长定时下线操作--结果---"+ru);
		return ru;
		
	}
}
